#include "win32RenderDevice.h"
#include "win32oglDriver.h"

USING_NAMESPACE_OXGE

Renderer* Win32RenderDevice::CreateGLRenderer( const RendererSetting& rendersetting )
{
	if( !WGLDRIVER.Init() ){
		return NULL;
	}		


	

	int iPixelFormat;
	UINT nFormatCount; 	

	Win32oglPixelFormat pixelFormat;	
	if( !wglChoosePixelFormatARB(m_hdc, pixelFormat.GetviAttribs(), pixelFormat.GetvfAttribs(), 1, &iPixelFormat, &nFormatCount ) )
		return NULL;

	if( nFormatCount ==0 || iPixelFormat ==0 )
		return NULL;	

	Win32oglRenderer* pRenderer  = new Win32oglRenderer();
	pRenderer->Initialize(m_hdc, iPixelFormat);
	return pRenderer;
}